package com.huiztech.maystall.http;

import com.huiztech.maystall.mvc.View;
import android.content.Context;
import android.util.Log;

public class MyAsyncHttpResponseHandler extends AsyncHttpResponseHandler {

	private Context context;
	private View view = null;
	
	public MyAsyncHttpResponseHandler(Context Context,View view) {
		this.setContext(Context,view);
	}


	public Context getSherlockContext() {
		return context;
	}

	public void setContext(Context context,View view) {
		this.context = context;
		this.view = view;
	}

	@Override
	public void onStart() {
		Log.i("onStart", "onStart");
		view = new View();
		view.showBusy();
	}

	@Override
	public void onFailure(Throwable error) {
		super.onFailure(error);
		view.serverConnectionsFailure();
	}
	
	@Override
	public void onFinish() {
		super.onFinish();
		view.clearBusy();
		Log.i("onFinish", "onFinish");
	}
}
